package com.hmall.order.config;

import com.hmall.order.itercptor.UserInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class MvcConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry){
       //默认的拦截路径就是/**  ，excludePathPatterns()是不用拦截的路径
        //  registry.addInterceptor(new UerInterceptor().addPathPatterns("*/**").excludePathPatterns();


        registry.addInterceptor(new UserInterceptor());
    }
}
